//
//  MPGridViewCell_iPad.h
//  MissPaparazzi
//
//  Created by Alexey Aleshkov on 19.08.12.
//  Copyright (c) 2012 DzeTech. All rights reserved.
//


#import <UIKit/UIKit.h>
#import "UIGlossyButton.h"
#import "MPEpisode.h"


@class MPGridViewCell;
@protocol MPGridViewCellDelegate <NSObject>
@optional
- (void)MPGridViewCell:(MPGridViewCell *)cell buy:(MPEpisode *)object;
- (void)MPGridViewCell:(MPGridViewCell *)cell open:(MPEpisode *)object;
- (void)MPGridViewCell:(MPGridViewCell *)cell download:(MPEpisode *)object;
- (void)MPGridViewCell:(MPGridViewCell *)cell cancelDownloading:(MPEpisode *)object;
- (void)MPGridViewCell:(MPGridViewCell *)cell remove:(MPEpisode *)object;
@end


typedef enum MPGridViewCellState
{
	MPGridViewCellBuy,
	MPGridViewCellDownload,
	MPGridViewCellDownloading,
	MPGridViewCellProcessing,
	MPGridViewCellDownloaded,
} MPGridViewCellState;


@interface MPGridViewCell : UIView
{
	MPEpisode *_data;
	
	UIGlossyButton *_removeButton;
	UIView *_openView;
	UIView *_processingView;
	UIProgressView *_downloadingProgressView;
	UILabel *_downloadingProgressLabel;
	UIView *_downloadingView;
	UIGlossyButton *_downloadButton;
	UIView *_downloadView;
	UIGlossyButton *_buyButton;
	UIView *_buyView;
	UILabel *_titleLabel;
	
	UIImageView *_videoImageView;
	
	MPGridViewCellState _state;
	
	id<MPGridViewCellDelegate> _delegate;
}

@property (nonatomic, assign) id<MPGridViewCellDelegate> delegate;
@property (nonatomic, readonly) MPGridViewCellState state;
@property (nonatomic, retain) MPEpisode *data;

@end
